// 导入request, 用于发送axios请求
import request from '@/utils/request'

// 获取病人列表
export const patientListService = (data) =>
  request.get('/patient/getPatientList', {
    params: data
  })

// 添加病人
export const patientAddPatientService = (data) =>
  request.post('/patient/addPatient', data)

// 修改病人
export const patientEditPatientService = (data) =>
  request.post('/patient/editPatient', data)

// 获取病人信息, 使用路径传参
export const patientGetPatientInfoService = (id) =>
  request.get(`/patient/getPatientInfo/${id}`)

// 根据病人id和记录id获取病史信息
export const patientGetPatientHistoryService = (
  patientId,
  recordId
) =>
  request.get(
    `/patient/getDiseaseHistory/${patientId}/${recordId}`
  )

// 根据病人id和记录id获取全身状况信息
export const patientGetPatientSystemicDisease = (
  patientId,
  recordId
) =>
  request.get(
    `/patient/getSystemicDisease/${patientId}/${recordId}`
  )

// 更新 病史信息
export const patientEditPatientHistoryService = (data) =>
  request.post('/patient/editDiseaseHistory', data)

// 更新 全身状况信息
export const patientEditPatientSystemicDiseaseService = (
  data
) => request.post('/patient/editSystemicDisease', data)

/**
 * 删除病人信息
 */
export const patientDeleteService = (id) =>
  request.delete(`/patient/deletePatient/${id}`)

/**
 * 更新患者的类型
 */
export const patientUpdatePatientClassifyAPI = (
  patientId,
  patientClassifyId
) =>
  request.put(
    `/patient/updatePatientClassify/${patientId}/${patientClassifyId}`
  )
